package com.botu.sentineldemo1.feign.client;

import com.botu.sentineldemo1.feign.fallback.EchoServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Author: hanzeyao
 * @Date: 2019/12/6 10:42
 * @Description:
 *
 * Feign 对应的接口中的资源名策略定义：httpmethod:protocol://requesturl。
 * @FeignClient 注解中的所有属性，Sentinel 都做了兼容。
 */
@FeignClient(name="nacos-producer",fallback = EchoServiceFallback.class)
public interface EchoService {
    @RequestMapping(value = "/echo/test",method = RequestMethod.GET)
    String echo();
}

/*class FeignConfiguration {
    @Bean
    public EchoServiceFallback echoServiceFallback() {
        return new EchoServiceFallback();
    }
}*/
